public class gaiLunHero extends Hero{
    public void init(){
        lifeStatus = true;
        setArmor(28);
        setAttackNumber(75);
        setLeve(1);
        setLifeNumber(602);
        setName("盖伦");
        setSpeed(335);
        setMySkill(new HeroSkill(){
        
            @Override
            public void showSkill() {
                System.out.println(getName()+"的技能说明.....");
                
            }
        
            @Override
            public void finalSkill() {
                System.out.println("审判!");
                
            }
        
            @Override
            public void attack() {
                System.out.println("attack!!");
                
            }
        });
        status();
    }

    public void status(){
        if(getLifeNumber() <= 0){
            lifeStatus = false;
            System.out.println("life end!");
        }            
        else
            System.out.println("状态:"+getName()+";生命值:"+getLifeNumber()+";攻击力:"+getAttackNumber()+";护甲:"+getArmor()+";移速:"+getSpeed()+";等级:"+getLeve()+" ");
    }

    public boolean lifeStatus(){
        return lifeStatus;
    }
    public void growLeve(){
        if(getLeve() < 18){
            int armor = getArmor();
            int attackNumber = getAttackNumber();
            int lifeNumber = getLifeNumber();
            int leve = getLeve();
            setArmor(armor+5);
            setAttackNumber(attackNumber+10);
            setLeve(leve++);
            setLifeNumber(lifeNumber+100);
            status();
            System.out.println("leve up!");
        }else{
            System.out.println("alread final leve 18!");
        }
    }

    public int attack(int armor){
        if(lifeStatus){
        int attackNumber = getAttackNumber();
        double finalAttack = Double.valueOf(attackNumber);
        double armorFinal = Double.valueOf(armor);
        if(armor>0){
            finalAttack = finalAttack*(1-(armorFinal/(armorFinal+100)));
        }
        attackNumber = (int)finalAttack;
        System.out.println("attck over! attack:"+attackNumber);
        return attackNumber;
    }else{
        System.out.println("life end!");
        return 0;
    }
    }

    public void attacked(int a){
        int lifeNumber = getLifeNumber();
        int attacked = attack(a);
        if(lifeNumber <= 0)
            System.out.println("life end!");
        else
            setLifeNumber(lifeNumber - attacked);
        status();
    }

    public int fireSkill(){
        int addattuck = getLeve()*20 + getAttackNumber();
        addattuck = attack(addattuck);
        System.out.println("fireSkill is damage:"+addattuck);
        return addattuck;
    }

}